#include <stdio.h>

void swap(int *p1,int *p2)
{
    int temp;
    temp = *p1;
    *p1 = *p2;
    *p2 = temp;
}
int main()
{
    int a = 10;
    int b = 20;
    printf("交换之前a,b的值分别为：\n");
    printf("a = %d\n",a);
    printf("b = %d\n",b);
    swap(&a,&b);
    printf("交换之后a,b的值分别为：\n");
    printf("a = %d\n",a);
    printf("b = %d\n",b);
}
